<script>
	import {
		getUrlKey
	} from "@/utils/post.js";
	export default {
		onLaunch: function(options) {
			if (process.env.NODE_ENV === 'development') {
				uni.setStorageSync('_USER_ACCESS_TOKEN','NDLzZUGA1TB0-TW37A6JhWWc8QJwmCxU')
			   // Config.debug = true;
			}else{
				//Config.debug = false;
			}
			console.log('app onLaunch--->'); // 公众号文章进小程序无底部导航调试，请勿删除
			console.log(options); // 公众号文章进小程序无底部导航调试，请勿删除
			console.log('<---app onLaunch'); // 公众号文章进小程序无底部导航调试，请勿删除
			if (options && options.scene) {	
				this.$appScene = options.scene;
			}
			this.$store.dispatch('mallConfig/actionGetConfig');
			let _this = this;
			wx.getSystemInfo({
				success: function(response) {
					_this.$store.dispatch('gConfig/setSystemInfo', response);
					_this.$store.dispatch('iPhoneX/setIphone', response);
				}
			});
			// #ifdef MP_WEIXIN
			if (options.scene == '1011' || options.scene == '1012' || options.scene == '1013' ||
				options.scene == '1047' || options.scene == '1048' || options.scene == '1049') {
				this.$store.dispatch('page/actionSetIsScanQrCode', true);
			}
			// #endif
			// #ifdef MP-ALIPAY
			if (typeof options.query != 'undefined') {
				this.$store.dispatch('page/actionSetQeury', options.query)
			}
			// #endif
			if (options.query && typeof options.query.user_id !== 'undefined') {
				this.$store.dispatch('user/setTempParentId', options.query.user_id)
			}

			//#ifdef H5
			var invite_id = getUrlKey('invite_id')
			var goods = getUrlKey('sharegoods')
			var mch_id = getUrlKey('mch_id')
			var type = getUrlKey('type')
			if (invite_id) {
				uni.setStorageSync('invite_id', invite_id)
			}
			if (goods) {
				uni.setStorageSync('sharegoods', goods)
			}
			if (mch_id) {
				uni.setStorageSync('s_mch_id', mch_id)
			}
			if (type) {
				uni.setStorageSync('gtype', type)
				var page = getCurrentPages()
				uni.setStorageSync('sharepage', page.path)
			}
			//#endif
		},
		onShow(options) {
			console.log('app onShow--->'); // 公众号文章进小程序无底部导航调试，请勿删除
			console.log(options); // 公众号文章进小程序无底部导航调试，请勿删除
			console.log('<--- app onShow'); // 公众号文章进小程序无底部导航调试，请勿删除
			if (options && options.scene) {
				this.$appScene = options.scene;
			}
		}
	};
</script>

<style lang="scss">
	/*每个页面公共css */
	// @import "./uni.scss";
	@import "./static/css/flex.scss";
	@import "./static/css/themeColor.scss";
	@import "./static/css/text.scss";
	@import "./static/css/image.scss";
	@import "./static/css/parse.scss";
	@import "./static/css/gift.scss";

	.nodetext {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.nodetext2 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.nodetext3 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
	}

	.clear {
		clear: both;
	}

	.hasmore {
		line-height: 80upx;
		height: 100upx;
		width: 100%;
		text-align: center;
		font-size: 24upx;
		color: #aaa;
	}
</style>
